﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FreedomERP.Dao;
using FreedomERP.Dao.Bd;
using FreedomERP.Dao.Bd.Impl;
using FreedomERP.Comm;


namespace FreedomERP.Services.Bd.Impl
{
    /// <summary>
    /// 商户信息管理业务层实现类
    /// </summary>
    public class BdOrgunitServiceImpl:IBdOrgunitService
    {
        IBdOrgunitDao orgunitDao = new BdOrgunitDaoImpl();
        public String findOrgunitId(String fOrgunitName){
            DAOResult<String> daoResult = orgunitDao.findOrgunitId(fOrgunitName);
            if(!daoResult.result)
            {
                throw new Exception(daoResult.msg);
            }else{
                if(daoResult.resultSet.Count<1){
                    throw new Exception("该商户信息不存在");
                }else{
                    return daoResult.resultSet.First<String>();
                }
            }

        }
    }
}